<%@ include file="/common/taglibs.jsp"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US"
	dir="ltr">
	<head>

		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<link rel="stylesheet" href="<c:url value="/css/adminsinglepage.css"/>"
			type="text/css" />

	</head>
	<body class="single-page single-page-col2">
		<div id="single-page-tbar">
			<h1>
				${members.uname}
			</h1>
		</div>
		<div class="spage-sidebar-wrap"> 
			<div id="single-page-sidebar">
				<div class="spage-side-nav">
					<ul>
						<li style="" class="cur" id="func-detailEdit" onclick="changeNav(this,'member_member')">
							<span>编辑会员</span>
						</li>
						<li style="" class="" id="func-detailOrders"  onclick="changeNav(this,'member_order')">
							<span>订单</span>
						</li>
						<li class="l-handle" id="func-showPointHistory" onclick="changeNav(this,'member_point_log')">
							<span>积分历史</span>
						</li>
						<li class="l-handle" id="func-member_ask" onclick="changeNav(this,'member_ask')">
							<span>咨询</span>
						</li>
						<li class="l-handle" id="func-member_feedback" onclick="changeNav(this,'member_discuss')">
							<span>评论</span>
						</li>

					</ul>
				</div>
			</div>
		</div>
		<div id="main" class="mainwrap">

			<div style="" class="spage-main-box"  id="member_member">
				<h3>
					编辑会员
				</h3>
				<div id="Member_Form_Edit_3">
					<form action="mb_member_save.html" method="post"
						id="member_form_name">
						<input name="members.memberId" value="${members.memberId }"
							type="hidden">
						<div class="division">
							<table border="0" cellpadding="0" cellspacing="0" width="100%">
								<tbody>
									<tr>
										<th>
											用户名:
										</th>
										<td>
											${members.uname}
										</td>
									</tr>
									<tr>
										<th>
											<font color="red">*</font>&nbsp;E-mail:
										</th>
										<td>
											 ${members.email } 
										</td>
									</tr>
									<tr>
										<th>
											会员等级:
										</th>
										<td>
											<div  class="object-select clearfix">
												<select name="members.memberLvId" id="newMemberLevelId">
													<c:forEach var="level" items="${memberLevels}">
														<option value="${level.mlId }">
															${level.name}
														</option>
													</c:forEach>
												</select>
												
											</div>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="division">
							<table border="0" cellpadding="0" cellspacing="0" width="100%">
								<tbody>
									<tr>
										<th>
											姓名
										</th>
										<td>
											<input name="members.name" value="${members.name}" type="text" />
										</td>
									</tr>
									<tr>
										<th>
											性别
										</th>
										<td>
											
											<c:if test="${members.sex}">男</c:if>
											<c:if test="${!members.sex}">女</c:if>
										</td>
									</tr>
									<tr>
										<th>
											固定电话
										</th>
										<td>
											${members.tel}
										</td>
									</tr>
									<tr>
										<th>
											出生日期
										</th>
										<td>
											${members.birthDay}
										</td>
									</tr>
									<tr>
										<th>
											地区
										</th>
										<td>
											<span   class="span _x_ipt"  >													
													${members.province }-${members.city}-${members.area}
											</span>
										</td>
									</tr>
									<tr>
										<th>
											移动电话
										</th>
										<td>
											${members.mobile }
										</td>
									</tr>
									<tr>
										<th>
											联系地址
										</th>
										<td>
											<input name="members.addr" value="${members.addr}" type="text" />
										</td>
									</tr>
									<tr>
										<th>
											邮编
										</th>
										<td>
											<input name="members.zip" value="${members.zip}" type="text" />
										</td>
									</tr>
									<tr>
										<th>
											安全问题
										</th>
										<td>
											<input name="members.passwordAnswer"
												value="${members.passwordAnswer }" type="text" />
										</td>
									</tr>
									<tr>
										<th>
											回答
										</th>
										<td>
											<input name="members.passwordQuestion"
												value="${members.passwordQuestion}" type="text" />
										</td>
									</tr>
									<tr>
										<th>
											QQ
										</th>
										<td>
											<input class="_x_ipt" name="11"   value=""  type="text" />
										</td>
									</tr>
									<tr>
										<th>
											MSN
										</th>
										<td>
											<input class="_x_ipt" name="12"   value="" type="text" />
										</td>
									</tr>

								</tbody>
							</table>
						</div>
						<div class="division">
							<table border="0" cellpadding="0" cellspacing="0" width="100%">
								<tbody>
									
<!--									<tr>-->
<!--										<th>-->
<!--											预存款金额:-->
<!--										</th>-->
<!--										<td>-->
<!--											${members.advance}-->
<!--										</td>-->
<!--									</tr>-->
									<tr>
										<th>
											注册日期:
										</th>
										<td>
											${members.regTimeDate}
										</td>
									</tr>
									<tr>
										<th>
											注册IP:
										</th>
										<td>
											${members.regIp}
										</td>
									</tr>
								</tbody>
							</table>
						</div>
						<h3>
							经验值
						</h3>
						<div class="division" id="Member_Form_Experience_3">
							<input name="all_reload" value="1" type="hidden">
								<table border="0" cellpadding="0" cellspacing="0" width="100%">
									<tbody>
										<tr>
											<th>
												当前经验值:
											</th>
											<td>													
													<input id="oldExperience" name="oldExperience" value="${members.experience}"  type="hidden"/>
													<input readonly="readonly" id="members_experience"    value="${members.experience}"  type="text"/>
											</td>
										</tr>
										<tr>
											<th>
												调整经验值（增/减）:
											</th>
											<td>
												<input onblur="adjustExperience()" size="20" name="members.addedExperience"  class="_x_ipt"  type="text"/>
													输入负值即可减少经验值； 
											</td>
										</tr>
									</tbody>
								</table>
						</div>
						<h3>
							积分
						</h3>
						<div class="division" id="Member_Form_Point_3">
							<input name="all_reload" value="1" type="hidden">
								<table border="0" cellpadding="0" cellspacing="0" width="100%">
									<tbody>
										<tr>
										<th>
											当前积分:
										</th>
										<td>											
											<input name="oldPoint" value="${members.point}"  id="oldPoint" type="hidden"/>
											<input readonly="readonly"   id="members_point" value="${members.point}"  type="text"/>
										</td>
									</tr>
										<tr>
											<th>
												调整积分（增/减）:
											</th>
											<td>
												<input onblur="adjustPoint()" size="20" name="members.addedPoint" class="_x_ipt" type="text"  />
													输入负值即可减少积分； 
											</td>
										</tr>
									</tbody>
								</table>
						</div>

						<h3>
							会员备注
						</h3>
						<div id="Remark_3">
							<div class="division">
								<input name="all_reload" value="1" type="hidden">
									<table border="0" cellpadding="0" cellspacing="0" width="100%">
										<tbody>
											<tr>
												<th>
													标记：
												</th>
												<td>
													<select style="width:80px;" name="members.remarkType" id="member_remark_type">
														<option value="b1">b1</option>
														<option value="b2">b2</option>
														<option value="b3">b3</option>
														<option value="b4">b4</option>
														<option value="b5">b5</option>
													</select>
													 
												</td>
											</tr>
											<tr>
												<th>
													会员备注：
												</th>
												<td>
													<textarea style="width: 750px; height: 200px;"
														name="members.remark">${members.remark }</textarea>
												</td>
											</tr>
										</tbody>
									</table>
							</div>
							<div class="table-action">
								<button type="submit" class="btn">
									<span><span>保存</span> </span>
								</button>
							</div>
						</div>
					</form>
				</div>
			</div>
			<div style="display: none;" class="spage-main-box" id="member_order">
				<h3>
					订单
				</h3>
				<div class="division">
					<table class="gridlist" border="0" cellpadding="0" cellspacing="0"
						width="100%">
						<col class="Colordernum">
							<col span="3">
								<col class="Colamount" align="left">
									<col class="Coldate">
										<thead>
											<tr>
												<th>
													订单号
												</th>
												<th>
													订单状态
												</th>
												<th>
													支付状态
												</th>
												<th>
													发货状态
												</th>
												<th>
													总金额
												</th>
												<th>
													下单日期
												</th>
											</tr>
										</thead>
										<tbody>
										</tbody>
					</table>
				</div>
			</div>


			<div style="display: none;" class="spage-main-box" id="member_point_log">
				<h3>
					积分历史
				</h3>
				<div class="division">
					<table class="gridlist" border="0" cellpadding="0" cellspacing="0"
						width="100%">
						<col class="Coldate">
							<col class="Coldetails">
								<col class="Colamount">
									<thead>
										<tr>
											<th>
												日期
											</th>
											<th>
												摘要
											</th>
											<th>
												积分
											</th>
										</tr>
									</thead>
									<tbody>
									<c:forEach var="pointLog" items="${marketPointLogs}"	varStatus="pointLogIndex">
										<tr> <td>${pointLog.createTimeDate }</td> <td class="Coldetails">${pointLog.reason}</td> <td class="Colamount">${pointLog.point }</td> </tr>
									</c:forEach>
									</tbody>
					</table>
				</div>
			</div>
			
			<div style="display: none;" class="spage-main-box" id="member_ask">
				<h3>
					咨询
				</h3>
				<div class="division">
					<table class="gridlist" border="0" cellpadding="0" cellspacing="0"
						width="100%">
						<col class="Colsn">
							<col class="Colname">
								<col class="Coldetails">
									<col class="Coldate">
										<thead>
											<tr>
												<th>
													用户名
												</th>
												<th>
													标题
												</th>
												<th>
													内容
												</th>
												<th>
													发表时间
												</th>
											</tr>
										</thead>
										<tbody>
											<c:forEach var="list" items="${asks}"	 >
												<tr> <td>${list.memberName}</td> <td>${list.title}</td> <td class="Coldetails">${list.comment}</td> <td>${list.createDate}</td> </tr>
											</c:forEach>
										</tbody>
					</table>
				</div>
			</div>
			<div style="display: none;" class="spage-main-box" id="member_discuss">
				<h3>
					评论 
				</h3>
				<div class="division">
					<table class="gridlist" border="0" cellpadding="0" cellspacing="0"
						width="100%">
						<col class="Colsn">
							<col class="Colname">
								<col class="Coldetails">
									<col class="Coldate">
										<thead>
											<tr>
												<th>
													用户名
												</th>
												<th>
													标题
												</th>
												<th>
													内容
												</th>
												<th>
													发表时间
												</th>
											</tr>
										</thead>
										<tbody>
											<c:forEach var="list" items="${discusses}"	 >
												<tr> <td>${list.memberName}</td> <td>${list.title}</td> <td class="Coldetails">${list.comment}</td> <td>${list.createDate}</td> </tr>
											</c:forEach>
										</tbody>
					</table>
				</div>
			</div>
		

		</div>
		<div id="footBar" class="footBar">
		</div>
 
		 
 
 
 
		 

		<script type="text/javascript"
			src="<c:url value='/scripts/jquery-1.4.2.js'/>"></script>
 
		<script type="text/javascript">
		
			function  adjustExperience(){
							
				var ex = $('#modify_experience').val().trim();
				var old = $('#oldExperience').val();
				var new_ex = 0 ; 
     			
				if(ex==''||isNaN(ex)){
					new_ex = old;
					
				}else{
					
					new_ex = parseInt(old) +parseInt(ex);
					if(new_ex<0){
						new_ex = 0;
					}
				}
				$('#members_experience').val(new_ex);
				
			
			}
			function  adjustPoint(){
				var ex = $('#modify_point').val().trim();;
				var old = $('#oldPoint').val();
				var new_ex = 0 ;			 
				 
				 
				if(ex==''||isNaN(ex)){
					new_ex = old;
					
				}else{
					new_ex = parseInt(old) +parseInt(ex);
					if(new_ex<0){
						new_ex = 0;
					}
				}
				
				
				
				
				$('#members_point').val(new_ex);
			}
			
			$('#newMemberLevelId').attr('value','${members.memberLvId}');	
			$('#member_sex').attr('value','${members.sex}');	
			$('#member_remark_type').attr('value','${members.remarkType}');
			
			
			function autoHeightAndWeight() {		
				$("#main").height($("body").height()-80);
				var width = $("body").width() - 150;
				$("#main").width(width);			

			}

		autoHeightAndWeight();  									 
 
	

function changeNav(obj,id){
	$("#single-page-sidebar > div  > ul > li").each(function(index, domEle) {
			$(domEle).removeClass("cur");
	});
	$(obj).addClass("cur");
	
	$("#main > div").each(function(index, domEle) {
			$(domEle).css("display","none");
	});
	$('#'+id).css("display","");

}


</script>
	</body>
</html>